<div class="layui-form" lay-filter="layuiadmin-form-admin" style="margin: 0 auto;">



    <div class="layui-form-item">
        <label class="layui-form-label">车辆编号</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="agvId" value="{{ d.params.agvId || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">车型</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="type" value="{{ d.params.type || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">公司名称</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="companyName" value="{{ d.params.companyName || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <!-- <div class="layui-form-item">
        <label class="layui-form-label">公司ID</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="companyId" value="{{ d.params.companyId || '' }}" lay-verify="" placeholder="请输入公司ID" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div> -->

    <div class="layui-form-item">
        <label class="layui-form-label">控制板编号</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="ctrlId" value="{{ d.params.ctrlId || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">控制板硬件版本</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="ctrlHardwareVersion" value="{{ d.params.ctrlHardwareVersion || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">控制板软件版本</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="ctrlSoftwareVersion" id="date" value="{{ d.params.ctrlSoftwareVersion || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">工控板编号：</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="agvId" value="{{ d.params.agvId || '' }}" lay-verify="" placeholder="请输入车辆编号" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">工控板硬件版本</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="hardwareVersion" value="{{ d.params.hardwareVersion || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">工控板软件版本</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="softwareVersion" value="{{ d.params.softwareVersion || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">添加时间</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="time" id='time' value="{{ d.params.time || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">交付时间</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="deliveryTime" id='deliveryTime' value="{{ d.params.deliveryTime || '' }}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">小车状态</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <!-- value="{{status==0?'正常使用':status==1?'故障状态':'生命周期结束'}}" -->
                <input type="text" name="status" value="{{d.params.status==0?'正常使用':d.params.status==1?'故障状态':'生命周期结束'}}" lay-verify="" readonly="readonly" class="layui-input">
            </script>
        </div>
    </div>
</div>

<style type="text/css">
    .layui-form-label {
        width: 115px;
    }
    
    .layui-input {
        border: none;
    }
</style>
<script>
    layui.use(['useradmin'], layui.factory('useradmin')).use(['admin', 'useradmin'], function() {
        var $ = layui.$,
            admin = layui.admin,
            setter = layui.setter,
            form = layui.form;

        admin.req({
            url: setter.request.baseUrl + "agv-info/query",
            data: JSON.stringify({
                pageNum: 1,
                pageSize: 100
            }),
            type: "POST",
            dataType: "json",
            contentType: "application/json;charset=UTF-8",
            done: function(res) {
                console.log(res);
                var html = "<option style='color:#e6e6e6;'></option>";
                for (i = 0; i < res.info.length; i++) {
                    if (res.info[i].companyName == null) {

                    } else {
                        html += "<option name='companyName'  value=" + res.info[i].companyName + ">" + res.info[i].companyName + "</option>"
                    }

                }
                console.log(html)
                $("#sosoaa").empty().append(html)
                form.render('select'); //需要渲染一下
            },

        });
    })
</script>